<html><head><title>SaveImage</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">SaveImage()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#006666"><b>SaveImage</b></font>(#Image, Filename$ [, ImagePlugin [, Flags [, Depth]]])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Saves the specified image to disk. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Image</i></td>
<td width="90%"> 
The image to save. 

</td></tr>
<tr><td><i>Filename$</i></td>
<td> 
The file to save to. If the filename does not include a full path, it 
is interpreted relative to the <a href="../filesystem/getcurrentdirectory.html">current directory</a>. 

</td></tr>
<tr><td><i>ImagePlugin (optional)</i></td>
<td> 
The format to save the image in. This can be one of the following values: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_ImagePlugin_BMP</font>      : Save the image in BMP (default)
  <font color="#924B72">#PB_ImagePlugin_JPEG</font>     : Save the image in JPEG (<a href="../imageplugin/usejpegimageencoder.html">UseJPEGImageEncoder()</a> has to be used)
  <font color="#924B72">#PB_ImagePlugin_JPEG2000</font> : Save the image in JPEG2000 (<a href="../imageplugin/usejpeg2000imageencoder.html">UseJPEG2000ImageEncoder()</a> has to be used)
  <font color="#924B72">#PB_ImagePlugin_PNG</font>      : Save the image in PNG (<a href="../imageplugin/usepngimageencoder.html">UsePNGImageEncoder()</a> has to be used)
</font></pre>

</td></tr>
<tr><td><i>Flags (optional)</i></td>
<td> 
Optional parameters for the image plug-in. For now, only the quality setting is supported: 
a number from 0 (worse quality) to 10 (maximum quality). Only the JPEG and JPEG 2000 plugins currently support it (default 
quality is set to '7' if no flags are specified). 
<br>
<br>
When an image is saved using palletized depth (1, 4 or 8), the following 
flag is available for combination: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Image_FloydSteinberg</font>: Apply a Floyd-Steinberg dithering.
</font></pre>

</td></tr>
<tr><td><i>Depth (optional)</i></td>
<td> 
The depth in which to save the image. Valid values are 1, 4, 8, 24 and 32. 
The default value is the original image depth. 
For now, only BMP and PNG encoders support palletized image format (1, 4 or 8-bit). 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Returns nonzero if the operation succeeded and zero if it failed. 

</blockquote><p><b>See Also</b></p><blockquote>

<a href="imagedepth.html">ImageDepth()</a>, 
<a href="../imageplugin/index.html">ImagePlugin library</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=resizeimage.html>ResizeImage()</a> - <a href=index.html>Image Index</a></body></html>